<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>首页</title>
    <link href="${ pageContext.request.contextPath}/web/assets/css/base.css" type="text/css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/web/assets/css/style.css" type="text/css" rel="stylesheet">
    <link href="${ pageContext.request.contextPath}/web/assets/css/banner.css" type="text/css" rel="stylesheet">
    <script src="${ pageContext.request.contextPath}/web/assets/jquery.min.js"></script>
    <script src="${ pageContext.request.contextPath}/web/assets/banner.js"></script>
    <script>
        function cancelStar(id,entityName) {
            $.ajax({
                url: "${pageContext.request.contextPath}/"+welcome,
                data: {action: 'cancelStar', id,entityName},
                // contentType: "application/json",
                type: "GET",
                success: function (data) {
                    alert(data.message);
                    location.reload()
                }
            });
        }
    </script>
</head>
<body>
<jsp:include page="./c-head.jsp"></jsp:include>

<div class="main-content" style="min-height: 680px">
    <div class="m-body">
        <div class="content-title">
            <h2>我的收藏</h2>
        </div>
        <div class="content-l">
<c:forEach items="${ stars }" var="i" varStatus="s">
            <div class="content-l-item">
                <a href="${ pageContext.request.contextPath}/welcome?entityName=${ i.itemtype}&id=${ i.itemid}">
                    <img src="${ pageContext.request.contextPath}/file?filename=${ i.showpic}" />
                    <p class="content-l-item-title" title="${i.showtitle}">${i.showtitle}</p>
                    <p class="content-l-item-tip" >${ i.showdesc}</p>
                    <a href="javascript:cancelStar('${ i.id}','${ i.itemtype}');">
                        <p class="content-l-item-tip">取消收藏</p>
                    </a>

                </a>
            </div>
</c:forEach>
        </div>
    </div>
</div>

<jsp:include page="./c-foot.jsp"></jsp:include>
</body>
</html>
